package com.example.basic;

public class JoinTest implements Runnable{
    @Override
    public void run() {
        for (int i = 0; i < 100; i++) {
            System.out.println(Thread.currentThread().getName());
        }
    }

    public static void main(String[] args) throws InterruptedException {
        JoinTest joinTest = new JoinTest();
        Thread t1 = new Thread(joinTest, "小明");
        Thread t2 = new Thread(joinTest, "小红");
        t1.start();
        t1.join();
        System.out.println("main");
        t2.start();
    }
}
